package com.mallcloud.mall.mall.api.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import com.mallcloud.mall.common.core.util.ValidGroup;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.springframework.format.annotation.DateTimeFormat;

import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.util.Date;

@ApiModel(value = "MallValueCardModel", description = "储值卡主表")
@Data
@EqualsAndHashCode(callSuper = false)
@TableName("CARD_ZB")
public class MallValueCardModel implements Serializable {
	private static final long serialVersionUID = 1L;

	@JsonSerialize(using = ToStringSerializer.class)
	@NotNull(message = "ID为空", groups = {ValidGroup.Update.class})
	@ApiModelProperty(value = "主键  插入必填")
	@TableId(value = "cmid", type = IdType.ASSIGN_ID)
	private Long id;

	@ApiModelProperty(value = "礼品卡主题名称")
	@TableField("cmthemename")
	private String themeName;

	@ApiModelProperty(value = "礼品卡主题图片")
	@TableField("cmthemeimage")
	private String themeImage;

	@ApiModelProperty(value = "礼品卡有效期-开始")
	@TableField("cmtermofvaliditystart")
	@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
	private Date startTime;

	@ApiModelProperty(value = "礼品卡有效期-结束")
	@TableField("cmtermofvalidityend")
	@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
	private Date endTime;

	@ApiModelProperty(value = "礼品卡使用须知")
	@TableField("cminstructionsforuse")
	private String ins;

	@ApiModelProperty(value = "储值卡面值")
	@TableField("cfvvalue")
	private String value;

	@ApiModelProperty(value = "礼品卡主题状态（Y生效 N失效 D删除）")
	@TableField("cmstatus")
	private String status;

//	@ApiModelProperty(value = "礼品卡主题添加日期")
//	@TableField("cmdatetime")
//	@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
//    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
//	private Date cmdatetime;
//
//	@ApiModelProperty(value = "礼品卡主题录入人")
//	@TableField("cmlrr")
//	private String cmlrr;
//
//	@ApiModelProperty(value = "MIS卡类别")
//	@TableField("cardtype")
//	private String cardtype;
//
//	@ApiModelProperty(value = "开始号段")
//	@TableField("kshd")
//	private String kshd;
//
//	@ApiModelProperty(value = "结束号段")
//	@TableField("jshd")
//	private String jshd;
}
